/* Copyright (C) 2003, Charles Wang.
 * Author:  Charles Wang <charles@linux.net.cn>
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANT; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public LIcense for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef __MAGICBOOTER_H__
#define __MAGICBOOTER_H__

typedef const char * (* ui_runner)(void);
typedef void         (* ui_saver)(FILE *fp);

typedef struct {
    const char *name;
    ui_runner   runner;
    const char *nullnext;
    ui_saver    saver;
}  mbstep;


/*--- Public variables ---*/
extern const char * kernelver;
extern const char * distname;
extern const char * langset;
extern const char * welcome;

/*--- Public variables for mi_initrd. ---*/
extern const char *mi_initrd_device;
extern const char *mi_initrd_file;
/* mi_initrd_root: The directory to mount mi_initrd_file. */
#define mi_initrd_root  "/mnt/miroot"

/* extern const char *mi_initrd_cramfs_file; */
/* mi_initrd_cramfs_root: The directory to mount mi_initrd_cramfs_file. */
/* #define mi_initrd_cramfs_root  "/tmp/root.cramfs.mnt" */

/* search_device_root: The directory to mount the real harddisk/cdrom device
   in search for optimize. */
#define search_device_root   "/tmp/device.mnt"

#define mi_hotfix_postfix   ".hotfix"

/* mi_initrd_fullpath: The path to the accessable mi_initrd_file.
 *  It will be subdirectory of mi_device_root or mi_isoloop_root. */
extern char mi_initrd_fullpath[1024];
extern char mi_hotfix_fullpath[1024];


/*-- Other public variables --*/
extern char errbuf[50];

/* Add flag */
extern int mb_flags;

#define MB_EXPERT       (1 << 0)
#define MB_RESCUE       (1 << 1)
#define MB_SHELL        (1 << 2)

#define FLAG_ENABLE(flag)   mb_flags |= MB_##flag
#define FLAG_DISABLE(flag)  mb_flags &= ~ MB_##flag
#define FLAG_TEST(flag)     ((mb_flags & MB_##flag) != 0)

#endif
